// GlobalResources.h
//
#ifndef GLOBALRESOURCES_H
#define GLOBALRESOURCES_H

#include "OpenGL.h"
#include "Program.h"
#include "FBO.h"
#include "VObjectGL.h"
#include "VPointGL.h"
#include "SymbolsMap.h"
#include "Font.h"
#include "TerrainShading.h"
#include "GmVectorFile.h"

#include <string>

#define CONSOLE_LOG(...) {	\
	if(GlobalResources::attachedConsole)\
		printf(__VA_ARGS__); \
		}

class QGLWidget;

namespace IDS{
namespace IDEAS{


// ------------------------------------------------------------------------------------------------
class GlobalResources
{
private:
	static int initialized;
	static QGLWidget *context;
	
	static void initGeoImageShader();
	static void initVPointShader();
	static void initRasterDataShader();

public:
	static std::string resourceDir;
	static unsigned char preselectColor[4];
	static unsigned char selectColor[4];

	static bool init(const std::string &resourcePath, std::string &errorLog, bool console);
	static void destroy();

	static GmVectorFile				geoBorders;
	static IDS::OpenGL::Program			rasterDataShader;
	static IDS::OpenGL::Program			geoImageShader;
	static IDS::OpenGL::Program			vpointShader;
	static IDS::OpenGL::TerrainShading	terrainShader;
	static IDS::OpenGL::SymbolsMap		symbolsMap;
	static IDS::OpenGL::FontTexture		arial;
	static QGLWidget *getSharingContext() {return context;}
	static bool attachedConsole;
};

}}

#endif